package com.ruoyi.web.core.config;

import lombok.Getter;

/**
 * TODO
 *
 * @author chenchuan2
 * @date 2023-05-17 14:56:19
 */
public enum ChatModel {

    GPT_3_5("gpt-3.5", "gpt-3.5-turbo", "gpt-3.5-turbo-0301"),
    GPT_4("gpt-4", "gpt-4", "gpt-4-0314");

    @Getter
    private String modelShortName;

    @Getter
    private String modelName;

    @Getter
    private String modelLongName;

    ChatModel(String modelShortName, String modelName, String modelLongName) {
        this.modelShortName = modelShortName;
        this.modelName = modelName;
        this.modelLongName = modelLongName;
    }

    public static ChatModel queryByModelName(String modelName) {
        for (ChatModel model : ChatModel.values()) {
            if (modelName.equals(model.getModelName())) {
                return model;
            }
        }
        return GPT_3_5;
    }
}
